<ul class="nav nav-tabs">
	<li ng-class="{'active':pagedata.op=='list'}"><a href="javascript:;" ng-click="access()">打印机列表</a></li>
	<li ng-class="{'active':pagedata.op=='edit'}"><a href="javascript:;" ng-click="access('edit')">添加打印机</a></li>
</ul>
<div class="panel panel-info" ng-if="pagedata.op=='list'">
	<div class="panel-heading">筛选</div>
	<div class="panel-body">
                <div class="form-group">
					<label class="col-xs-12 col-sm-3 col-md-2 left-label">打印机名称</label>
					<div class="col-sm-9 col-xs-12">
						<input type="text" name="title" class="form-control" ng-model="pagedata.params.title"/>
						<div class="help-block">设置打印机名称，便于识别使用</div>
					</div>
				</div>
				<div class="form-group" ng-include="sys_html('common/createtime',true)"></div>
				<div class="form-group" ng-include="sys_html('common/find',true)"></div>
	</div>
</div>
<div class="clearfix table-responsive" ng-if="pagedata.op=='list'">
	<form method="post" class="form-horizontal jinyun-form" id="form1">
	<table class="table jinyun-table table-hover vertical-middle">
		<thead class="navbar-inner">
			<tr>
				<th style="width:80px;">删除</th>
				<th>打印机名称</th>
				<th>商户ID</th>
				<th>创建时间</th>

				<th class="text-right" style="width:140px;">编辑</th>
			</tr>
		</thead>
			<tr ng-repeat="item in pagedata.list">
				<td>
				<input class="del" id="id-{{item.id}}" type="checkbox"  name="ids[]" value="{{item.id}}">
				<label class="text-over reply-item-name" for="id-{{item.id}}">&nbsp;</label>
				</td>
				<td>{{item.title}}</td>
				<td>{{item.mchid}}</td>
				<td>{{item.createtime}}</td>

				<td><a href="javascript:;" ng-click="access('edit','id='+item.id)" class="btn btn-default">编辑</a>
				<a href="javascript:;" ng-click="delone(item.id)" title="删除" class="btn btn-default btn-sm"><i class="fa fa-times"></i></a></td>
			</tr>
	</table>
	<div>
		<input id="select_all" type="checkbox" name=""  class="jinyun-margin-left" onclick="var ck = this.checked;$(':checkbox').each(function(){this.checked = ck});">
		<label for="select_all">&nbsp;</label>
		<button class="btn btn-danger" ng-click="del()">删除</button>
		</div>
	</form>
	<!-- 分页导航 -->
	<div ng-include="sys_html('common/page',true)"></div>
</div>

<div id="editform" ng-if="pagedata.op=='edit'" class="form-horizontal form">
	<div class="panel panel-default">
		<div class="panel-heading">设置打印机信息</div>
		<div class="panel-body">
                <div class="form-group" >
					<label class="col-xs-12 col-sm-3 col-md-2 left-label">打印机名称</label>
					<div class="col-sm-9 col-xs-12">
						<input type="text" name="title" class="form-control bitian" ng-model="pagedata.item.title"/>
						<div class="help-block">设置打印机名称，便于识别使用</div>
					</div>
				</div>
                 <div class="form-group" >
					<label class="col-xs-12 col-sm-3 col-md-2 left-label">商户ID</label>
					<div class="col-sm-9 col-xs-12">
						<input type="text" name="mchid" class="form-control bitian" ng-model="pagedata.item.mchid"/>
						<div class="help-block">前往进云智能云平台注册并获取商户ID</div>
					</div>
				</div>
                 <div class="form-group" >
					<label class="col-xs-12 col-sm-3 col-md-2 left-label">API密钥</label>
					<div class="col-sm-9 col-xs-12">
						<input type="text" name="miyue" class="form-control " ng-model="pagedata.item.miyue"/>
						<div class="help-block">从进云智能云平台获取</div>
					</div>
				</div>
                 <div class="form-group" >
					<label class="col-xs-12 col-sm-3 col-md-2 left-label">打印机序列号</label>
					<div class="col-sm-9 col-xs-12">
						<input type="text" name="pid" class="form-control " ng-model="pagedata.item.pid"/>
						<div class="help-block">从打印机机身获取</div>
					</div>
				</div>
                 <div class="form-group" >
					<label class="col-xs-12 col-sm-3 col-md-2 left-label">打印机设备编码</label>
					<div class="col-sm-9 col-xs-12">
						<input type="text" name="code" class="form-control bitian" ng-model="pagedata.item.code"/>
						<div class="help-block">从打印机机身获取</div>
					</div>
				</div>

		</div>
	</div>
	<div class="form-group col-sm-12">
		<button class="btn btn-primary" ng-click="post(pagedata.item,'post')">提交</button>
	</div>
</div>